package priv.wangy.micro.common.po.valid;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import priv.wangy.micro.common.po.valid.validator.StringValuesValidator;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * String类型选择项校验
 *
 * @author zhangjq
 * @since 2023-12-26
 */
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = StringValuesValidator.class)
public @interface StringValues {

    String[] values();

    String message() default "不在输入限制指定的范围内";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
